﻿using FollowMe.Model;
using System;
using System.Collections.Generic;
using System.Linq;

namespace FollowMe.Repository
{
    /// <summary>
    /// 
    /// </summary>
    public class RegistrationIDRepository : Repository<RegistrationID, Guid>, IRegistrationIDRepository
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RegistrationIDRepository"/> class.
        /// </summary>
        /// <param name="fm">The fm.</param>
        public RegistrationIDRepository(IContext fm)
            : base(fm)
        { }

        /// <summary>
        /// Finds the registration IDs for a member.
        /// </summary>
        /// <param name="Id">The identifier.</param>
        /// <returns></returns>
        public IEnumerable<RegistrationID> FindByMember(Guid Id)
        {
            return GetObjectSet().Where(m => m.MemberID == Id);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RegistrationIDRepository"/> class.
        /// </summary>
        public RegistrationIDRepository() { }
    }
}
